/**
 * Created by kaki on 2017/8/25.
 */
export const rules = {
  name: [
    { required: true, message: '请输入活动名称', trigger: 'blur' },
    { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
  ],
  age: [
    { required: true, message: '请输入年龄' }
  ],
  membership: [
    { required: true, message: '请选择责任会籍', trigger: 'change' }
  ],
  cardClass: [
    { required: true, message: '请选择卡种', trigger: 'change' }
  ],
  coach: [
    { required: true, message: '请选择责任教练', trigger: 'change' }
  ],
  tel: [
    { required: true, message: '请填写电话号码' },
    { validator: (rule, value, callback) => {
      const myreg = /1[3578][0-9]{9}/
      if (!myreg.test(value)) {
        callback(new Error('请输入国内手机号码'))
      } else {
        callback()
      }
    } }
  ]
}
